package com.huawei.hwid.vermanager;

import android.content.Context;
import android.graphics.Bitmap;
import android.net.http.SslError;
import android.webkit.SslErrorHandler;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import com.huawei.hwid.core.d.b.e;
import com.huawei.secure.android.common.ssl.WebViewSSLCheck;

public class a extends WebViewClient {
    private com.huawei.cloudservice.a a = null;
    private Context b;

    public a(Context context, com.huawei.cloudservice.a aVar) {
        this.a = aVar;
        this.b = context;
    }

    public void onPageFinished(WebView webView, String str) {
        super.onPageFinished(webView, str);
        e.b("ReleaseAccountCenterWebViewClient", "onPageFinished", true);
        this.a.a(webView, str);
    }

    public void onPageStarted(WebView webView, String str, Bitmap bitmap) {
        super.onPageStarted(webView, str, bitmap);
        e.b("ReleaseAccountCenterWebViewClient", "onPageStarted", true);
        this.a.a(webView, str, bitmap);
    }

    public void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) {
        e.d("ReleaseAccountCenterWebViewClient", "ReceivedSslError, SslErrorHandler cancel.", true);
        if (this.b == null) {
            sslErrorHandler.cancel();
        } else {
            WebViewSSLCheck.checkServerCertificateNew(sslErrorHandler, sslError, this.b);
        }
    }
}
